-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8343336: Add persistentScrollBars preference #1618
Conversation
👋 Welcome back mstrauss! A progress list of the required criteria for merging this PR into |
@mstr2 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 5 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
@mstr2 has indicated that a compatibility and specification (CSR) request is needed for this pull request. @mstr2 please create a CSR request for issue JDK-8343336 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
Webrevs
|
This looks like a useful data point. I am curious as to what are the criteria for including or excluding a particular preference? What is our long term goal - should we support all the preferences available on a particular platform, or the intersection, or what? May be it's something to discuss first on the mailing list. |
My thinking is that a particular preference should be useful and almost universally supported on the desktop platforms to make it into JavaFX API. The number of preferences we might consider are pretty limited, so I don't expect I think this is a minor addition that doesn't change anything substantial about |
Changed the naming from |
This seems like the right criteria to me.
Good.
With this explanation, I agree. |
Reviewers: @andy-goryachev-oracle @lukostyra (I'll look over the public API and the CSR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code changes look good, and both the property and the key reflect the platform preference on macOS M1 14.7.
I'll test windows tomorrow, and if someone can test it on linux, that would be fantastic!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good on win11, both property and windows key get updated in the monkey tester.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. In addition to reviewing the code and the docs, I tested it on all platforms. On Linux I tested it on Ubuntu 24.04 and on a very old 16.04. There is a minor bug on 16.04 (a warning printed), but it could be done as a follow-up if you prefer.
I reviewed the CSR, so it is ready to finalize.
@@ -121,6 +121,10 @@ jobject PlatformSupport::collectPreferences() const { | |||
gboolean enableAnimations = true; | |||
g_object_get(settings, "gtk-enable-animations", &enableAnimations, NULL); | |||
putBoolean(env, prefs, "GTK.enable_animations", enableAnimations); | |||
|
|||
gboolean overlayScrolling = true; | |||
g_object_get(settings, "gtk-overlay-scrolling", &overlayScrolling, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes a warning to be printed during initialization on a very old Ubuntu system (16.04) when running any application:
GLib-GObject-WARNING **: g_object_get_valist: object class 'GtkSettings' has no property named 'gtk-overlay-scrolling'
I see from the docs that this setting was added in GTK 3.24.9. Perhaps a runtime check is in order? It could be done as a follow-up bug since it is just a warning. It correctly reports GTK.overlay_scrolling=true
and persistentScrollBars=false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a runtime check for the gtk-overlay-scrolling
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning is gone on my Ubuntu 16.04 system. I note that the GTK.overlay_scrolling
preference is not reported on that system (which seems fine) and that the persistentScrollBarsProperty
is always false
. Everything still works as expected on systems with a newer GTK.
@@ -121,6 +121,12 @@ jobject PlatformSupport::collectPreferences() const { | |||
gboolean enableAnimations = true; | |||
g_object_get(settings, "gtk-enable-animations", &enableAnimations, NULL); | |||
putBoolean(env, prefs, "GTK.enable_animations", enableAnimations); | |||
|
|||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(settings), "gtk-overlay-scrolling")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, presuming that we want the property to be absent on systems that don't support this setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, a property that isn't available shouldn't be included in the preferences map. We've documented that in Platform.Preferences
:
* The preferences that are reported by the platform may be dependent on the operating system version
* and its current configuration, so applications should not assume that a particular preference is
* always available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ship it!
/integrate |
Going to push as commit da6ad4b.
Your commit was automatically rebased without conflicts. |
This PR adds another accessibility preference that is available on all supported desktop platforms:
When the OS setting is changed, all platforms report updates that can be observed in JavaFX.
The manual test application
test/manual/events/PlatformPreferencesChangedTest
can be used to test the feature./reviewers 2
/csr
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1618/head:pull/1618
$ git checkout pull/1618
Update a local copy of the PR:
$ git checkout pull/1618
$ git pull https://git.openjdk.org/jfx.git pull/1618/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1618
View PR using the GUI difftool:
$ git pr show -t 1618
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1618.diff
Using Webrev
Link to Webrev Comment